<?php


/**
 * Notes:
 * PROJECT_NAME : ERP v1.8 重构erp
 * User: 夏鱼儿<397072174@qq.com>
 * Date: 2024/8/5
 * Time: 20:52
 */

namespace app\service\traits\model\lines;

use app\admin\model\AdminMenu;
use app\admin\model\AdminRole;
use app\admin\model\AdminRoleMenu;
use app\admin\model\AdminUser;
use app\admin\model\AdminUserDividend;
use app\admin\model\AdminUserRole;
use think\model\relation\BelongsTo;
use think\model\relation\HasMany;
use think\model\relation\HasOne;

/**
 * 管理端
 * @property  AdminUser $adminUser
 * @property  AdminUser $adminUsers
 * @property  AdminUser $adminUserO
 * @property  AdminRole $adminRole
 * @property  AdminRole $adminRoles
 * @property  AdminRole $adminRoleO
 * @property  AdminMenu $adminMenu
 * @property  AdminMenu $adminMenus
 * @property  AdminMenu $adminMenuO
 * @property  AdminRoleMenu $adminRoleMenu
 * @property  AdminRoleMenu $adminRoleMenus
 * @property  AdminRoleMenu $adminRoleMenuO
 * @property  AdminUserRole $adminUserRole
 * @property  AdminUserRole $adminUserRoles
 * @property  AdminUserRole $adminUserRoleO
 * @property  AdminUserDividend $adminUserDividend
 * @property  AdminUserDividend $adminUserDividends
 * @property  AdminUserDividend $adminUserDividendO
 */
trait Admin
{
    /**
     * 管理员表-用户表
     * @return hasMany
     */
    public function adminUsers(): hasMany
    {
        return $this->hasMany(AdminUser::class);
    }

    /**
     * 管理员表-用户表
     * @return BelongsTo
     */
    public function adminUser(): BelongsTo
    {
        return $this->BelongsTo(AdminUser::class);
    }

    /**
     * 管理员表-用户表
     * @return hasOne
     */
    public function adminUsersO(): hasOne
    {
        return $this->hasOne(AdminUser::class);
    }

    /**
     * 管理员表-用户表-角色表
     * @return hasMany
     */
    public function adminRoles(): hasMany
    {
        return $this->hasMany(AdminRole::class);
    }

    /**
     * 管理员表-用户表-角色表
     * @return BelongsTo
     */
    public function adminRole(): BelongsTo
    {
        return $this->BelongsTo(AdminRole::class);
    }

    /**
     * 管理员表-用户表-角色表
     * @return hasOne
     */
    public function adminRoleO(): hasOne
    {
        return $this->hasOne(AdminRole::class);
    }

    /**
     * 管理员表-用户表-菜单表
     * @return hasMany
     */
    public function adminMenus(): hasMany
    {
        return $this->hasMany(AdminMenu::class);
    }

    /**
     * 管理员表-用户表-菜单表
     * @return BelongsTo
     */
    public function adminMenu(): BelongsTo
    {
        return $this->BelongsTo(AdminMenu::class);
    }

    /**
     * 管理员表-用户表-菜单表
     * @return hasOne
     */
    public function adminMenuO(): hasOne
    {
        return $this->hasOne(AdminMenu::class);
    }

    /**
     * 管理员表-用户表-菜单表
     * @return hasMany
     */
    public function adminRoleMenus(): hasMany
    {
        return $this->hasMany(AdminRoleMenu::class);
    }

    /**
     * 管理员表-角色表-菜单表
     * @return BelongsTo
     */
    public function adminRoleMenu(): BelongsTo
    {
        return $this->BelongsTo(AdminRoleMenu::class);
    }

    /**
     * 管理员表-角色表-菜单表
     * @return hasOne
     */
    public function adminRoleMenuO(): hasOne
    {
        return $this->hasOne(AdminRoleMenu::class);
    }


    /**
     * 管理员表-用户表-角色表
     * @return hasMany
     */
    public function AdminUserRoles(): hasMany
    {
        return $this->hasMany(AdminUserRole::class);
    }

    /**
     * 管理员表-用户表-角色表
     * @return BelongsTo
     */
    public function AdminUserRole(): BelongsTo
    {
        return $this->BelongsTo(AdminUserRole::class);
    }

    /**
     * 管理员表-用户表-角色表
     * @return hasOne
     */
    public function AdminUserRoleO(): hasOne
    {
        return $this->hasOne(AdminUserRole::class);
    }

    /**
     * 管理员表-用户表-分红表
     * @return hasOne
     */
    public function AdminUserDividendO(): hasOne
    {
        return $this->hasOne(AdminUserDividend::class);
    }


    /**
     * 管理员表-用户表-分红表
     * @return hasMany
     */
    public function AdminUserDividends(): hasMany
    {
        return $this->hasMany(AdminUserDividend::class);
    }

    /**
     * 管理员表-用户表-分红表
     * @return BelongsTo
     */
    public function AdminUserDividend(): BelongsTo
    {
        return $this->BelongsTo(AdminUserDividend::class);
    }
}